package com.ff.javamonkey.ui.notification;

import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import android.widget.RemoteViews;

import com.ff.javamonkey.R;

public class NotificationView {
	// Debugging
	private static final String TAG = "NotificationView";
	
	public static Notification notificationWithProgressBar(Context context, String title, String subtitle, int p) {
		PendingIntent pIntent = PendingIntent.getActivity(context, 0, null, 0);
		Notification notification = new Notification(
				R.drawable.ff_notif, title, System.currentTimeMillis());
		notification.contentIntent = pIntent;
		notification.contentView = new RemoteViews(context.getPackageName(), R.layout.notification_layout);
		notification.contentView.setImageViewResource(R.id.status_icon, R.drawable.ff_notif);
		notification.contentView.setTextViewText(R.id.title, title);
		notification.contentView.setTextViewText(R.id.subtitle, subtitle);
		notification.contentView.setProgressBar(R.id.status_progress, 100, p, false);
		return notification;
	}
	
	public static Notification generalNotification(Context context, String title, String subtitle) {
		PendingIntent pIntent = PendingIntent.getActivity(context, 0, null, 0);
		
		Notification notification = new Notification(
				R.drawable.ff_notif, title + " " + subtitle, System.currentTimeMillis());
		notification.contentIntent = pIntent;
		notification.contentView = new RemoteViews(context.getPackageName(), R.layout.notification_mainview_layout);
		notification.contentView.setImageViewResource(R.id.status_icon, R.drawable.ff_notif);
		notification.contentView.setTextViewText(R.id.title, title);
		notification.contentView.setTextViewText(R.id.subtitle, subtitle);
		return notification;
	}
}
